import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";

export class HomePageService {

  @Inject(NetService)
  private netService: NetService


  /**
   * 获取当日新增案件
   */
  public getTodayInsertCaseCount(data) {
    return this.netService.send({
      server: domainService.homePageController.getTodayInsertCaseCount,
      data
    })
  }


  /**
   * 催收案件数量统计
   */
  public getCollectionCaseCount(data) {
    return this.netService.send({
      server: domainService.homePageController.getCollectionCaseCount,
      data
    })
  }

  /**
   * 流出案件数量统计
   */
  public getOutCaseCount(data) {
    return this.netService.send({
      server: domainService.homePageController.getOutCaseCount,
      data
    })
  }

  /**
   * 行动代码监控
   */
  public actionCodeMonitor(overduePeriod: number) {
    return this.netService.send({
      server: domainService.homePageController.actionCodeMonitor,
      data: {
        overduePeriod
      }
    })
  }

  /*
   * 获取催收员案件量
   */
  public getHomeCaseTotal() {
    return this.netService.send({
      server: domainService.homePageController.getHomeCaseTotal,
    })
  }

  /**
   * 催收员回款排行
   */
  public getCollectorRackIngData(data: any) {
    return this.netService.send({
      server: domainService.homePageController.getCollectorRackIngData,
      data
    })
  }
  /**
   * 案件总数
   */
  public getAllCaseCount(data) {
    return this.netService.send({
      server: domainService.homePageController.getAllCaseCount,
      data
    })
  }
  /**
   * 车库车辆
   */
  public getAllWarehouseCar(data) {
    return this.netService.send({
      server: domainService.homePageController.getAllWarehouseCar,
      data
    })
  }

  // 排名
  public getCollectionRanking(data) {
    return this.netService.send({
      server: domainService.homePageController.getCollectionRanking,
      data
    })
  }
  /**
   * 待催收案件
   */
  public getWaitCollectCaseChart() {
    return this.netService.send({
      server: domainService.homePageController.getWaitCollectCaseChart
    })
  }
  /**
   * 流出案件
   */
  public getOutCaseChart() {
    return this.netService.send({
      server: domainService.homePageController.getOutCaseChart
    })
  }
  /**
   * 回款统计
   */
  public getRepaymentChart(data) {
    return this.netService.send({
      server: domainService.homePageController.getRepaymentChart,
      data
    })
  }
}
